﻿<%@ Page Title="" Language="C#" MasterPageFile="~/AdminSite.Master" AutoEventWireup="true" CodeBehind="AgentFile.aspx.cs" Inherits="Agents.Admin.AgentFile" %>
<asp:Content ID="Header" ContentPlaceHolderID="Header" runat="server">
</asp:Content>
<asp:Content ID="MainContent" ContentPlaceHolderID="MainContent" runat="server">
	<h1>
		צפיה בסוכן
	</h1>            
	<hr /> 
	<div id="gvDiv" style="direction:rtl">      
		<h3>יומן פעולות של הסוכן <%= (new Agents.Queries()).GetAgent(Int32.Parse(Request.QueryString["agentId"])).Name %>
		<br />
		 בתאריך: <%= DateTime.Parse(Request.QueryString["date"]).ToString("D") %></h3>
		<asp:DataGrid runat="server" ID="dgLogActions" AutoGenerateColumns="False"
			AllowPaging="True" PageSize="12" PagerStyle-Mode="NumericPages" 
			DataSourceID="SqlDataSource1" BackColor="White" BorderStyle="None" 
			CellPadding="3" GridLines="Both" 
			onpageindexchanged="dgLogActions_PageIndexChanged" 
			CssClass="dataGrid" Font-Names="Verdana" BorderColor="#999999" BorderWidth="1px">
			<AlternatingItemStyle BackColor="#DCDCDC" />
			<Columns>
				<asp:BoundColumn DataField="Date" HeaderText="זמן" ItemStyle-Wrap="false" HeaderStyle-Wrap="false"/>
				<asp:BoundColumn DataField="Description" HeaderText="הפעולה שבוצעה" ItemStyle-Wrap="false" HeaderStyle-Wrap="false"/>
			</Columns>
			<FooterStyle BackColor="#CCCCCC" ForeColor="Black" />
			<HeaderStyle BackColor="#000084" Font-Bold="True" ForeColor="White" />
			<ItemStyle BackColor="White" ForeColor="Black" />
			<PagerStyle Mode="NumericPages" BackColor="#999999" ForeColor="Black" 
			HorizontalAlign="Center"></PagerStyle>
			<SelectedItemStyle BackColor="#008A8C" Font-Bold="True" ForeColor="White" />
		</asp:DataGrid>
		<asp:SqlDataSource ID="SqlDataSource1" runat="server" OnSelected="SqlDataSource1_Selected"
			ConnectionString="<%$ ConnectionStrings:AgentConnectionString %>" 
			SelectCommand="SELECT	Date, Description
							FROM AgentsActionLog
							WHERE ((CONVERT(Date, Date) = CONVERT(Date, @date))
									AND (AgentId = @agentId))
							ORDER BY Date">
			<SelectParameters>
				<asp:QueryStringParameter QueryStringField="date" Name="date" />
				<asp:QueryStringParameter QueryStringField="agentId" Name="agentId" />
			</SelectParameters>
		</asp:SqlDataSource>
	</div>
	<asp:Label ID="lblMessage" runat="server" />
	<br />           
	<hr />
	<div class="alignCenter">               
		<asp:Button ID="printBtn" Text="הדפס" runat="server" CssClass="button" />
		<asp:Button ID="backBtn" Text="חזור" runat="server" 
			onclick="backBtn_Click" CssClass="button" />
	</div>
</asp:Content>
